﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="PR_BudgetManagements.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PR_BudgetManagements" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  
<script type="text/javascript">   

          function isNumberKey(event)  // ตัวเลขอย่างเดียว
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57)){
//                 alert("กรอกได้แต่ตัวเลขครับ!")
                 return false;
	          }
             return true;
          }
          
          function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
          } 

</script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="btnSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
    
      <asp:panel ID="Panel6" runat="server" >
        <table width="30%" cellpadding="0" cellspacing="0">
        <tr>
           <td valign="top" align="left">
               
               <uc2:user ID="user1" runat="server" />
               
            </td>
            <td width="20" >
                &nbsp;</td>
            <td>
            <div class="moduleDivSlim700">
                    <div class="moduleDivBottom700">
                         <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
                            <table align = "center" width = "700px">
                                <tr>
                                <td align="right">
                        ประเภทบุคลากร : </td>
                        <td align = "left">
                        <telerik:RadComboBox ID="cmbEmployeeType" runat="server" AutoPostBack="True" 
                              CausesValidation="false" DataTextField="Name" DataValueField="Sequence" 
                              EmptyMessage="... ประเภทบุคลากร..." Filter="Contains" 
                              OnClientTextChange="onTextChange" 
                              onselectedindexchanged="cbEmployeeType_SelectedIndexChanged" 
                              Width="150px">
                          </telerik:RadComboBox>  
                    </td>
                                <td align="right">
                        ปีงบประมาณ : </td>
                        <td align = "left">
                        <telerik:RadComboBox 
                            runat="server" 
                            ID="cmbFilterYear" 
                            DataValueField = "Name"
                            DataTextField = "Name"
                            Filter ="Contains"
                            CausesValidation ="false"
                            OnClientTextChange = "onTextChange"
                            Width = "100px" AutoPostBack="True" 
                            onselectedindexchanged="cmbYear_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </td>
                    <td align="right">การเลื่อนเงินเดือน : </td>
                        <td align = "left">
                        <asp:RadioButtonList ID="radPromotion" runat="server" AutoPostBack = "true"
                                onselectedindexchanged="radPromotion_SelectedIndexChanged" 
                                RepeatDirection="Horizontal">
                              <asp:ListItem Value="1" Selected = "True">ครั้งที่ 1</asp:ListItem>
                              <asp:ListItem Value="2">ครั้งที่ 2</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    </tr>
                    </table>
                    </asp:Panel>
                    </div>
                </div>
            </td>
          </tr>
          <tr>
          <td colspan = "3">
         
        <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">

        <table width ="980px" align = "center">
        <tr>
            <td align="left" class="tableHeader" colspan="3">
                จัดสรรวงเงินการเลื่อนเงินเดือน</td>
        </tr>
        <tr>
        <td >
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Width="970px" 
            Height="410px" ScrollBars="Auto" >
                <telerik:RadGrid ID="RadGrid2" runat="server" 
                    AllowAutomaticDeletes="False" 
                    AllowAutomaticInserts="False"
                    AllowAutomaticUpdates="False"
                    AllowFilteringByColumn="True"
                    AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False" EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" GridLines="None"                    
                    Skin="Outlook" Width="950px" 
                    onitemcommand="RadGrid2_ItemCommand">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        ClientDataKeyNames="mng_seq" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="mng_seq" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        
                                    </td>
                                    <td align="right">
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
  
                        <ExpandCollapseColumn Visible="True">
                        </ExpandCollapseColumn>
                        <Columns>                        
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                                UniqueName="EditCommandColumn"
                                EditText="คลิกเพื่อแก้ไขข้อมูล">
                                <ItemStyle Width="15px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn Visible = "false"
                                DataField="job_site_seq" 
                                HeaderText="job_site_seq" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                CurrentFilterFunction="Contains"
                                AutoPostBackOnFilter="true"
                                HeaderStyle-HorizontalAlign = "Center"
                                UniqueName="job_site_seq">
                            </telerik:GridBoundColumn>       
                            <telerik:GridTemplateColumn 
                                HeaderText="สำนัก/กอง" 
                                AllowFiltering = "false"
                                SortExpression="job_site_name" 
                                UniqueName="job_site_name"
                                ColumnEditorID="editJobSiteName"
                                HeaderStyle-HorizontalAlign = "Center"
                                EditFormColumnIndex="1">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblJobSiteName" 
                                        Text='<%# Eval("job_site_name") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="tbJobSiteName" 
                                        Text='<%# Bind("job_site_name") %>'>
                                    </asp:TextBox>                                
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>   
                            <telerik:GridTemplateColumn 
                                HeaderText="วงเงินที่จัดสรร(%)" 
                                AllowFiltering = "false"
                                SortExpression="budget_percent" 
                                UniqueName="budget_percent"
                                ColumnEditorID="editPercent"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                EditFormColumnIndex="1">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblPercent" 
                                        Text='<%# Eval("budget_percent", "{0:N2}") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="tbPercent" 
                                        Text='<%# Bind("budget_percent") %>'>
                                    </asp:TextBox>                                
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn 
                                HeaderText="วงเงินที่จัดสรร(บาท)" 
                                AllowFiltering = "false"
                                SortExpression="amount" 
                                UniqueName="amount"
                                ColumnEditorID="editAmount"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                EditFormColumnIndex="1">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblAmount" 
                                        Text='<%# Eval("amount", "{0:N2}") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="tbAmount" 
                                        Text='<%# Bind("amount") %>'>
                                    </asp:TextBox>                                
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>   
                            <telerik:GridTemplateColumn 
                                HeaderText="วงเงินที่จัดสรรจริง(บาท)" 
                                AllowFiltering = "false"
                                SortExpression="amount_net" 
                                UniqueName="amount_net"
                                ColumnEditorID="editAmountNet"
                                HeaderStyle-HorizontalAlign = "Center"
                                ItemStyle-HorizontalAlign = "Center"
                                EditFormColumnIndex="1">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblAmountNet" 
                                        Text='<%# Eval("amount_net", "{0:N2}") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="tbAmountNet" 
                                        Text='<%# Bind("amount_net") %>'>
                                    </asp:TextBox>                                
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>   
                        </Columns>
                        <EditFormSettings 
                                    EditFormType="WebUserControl" 
                                    UserControlName="../UserControls/PR_BudgetManagements.ascx">
                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                </EditFormSettings>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView>
                            <ClientSettings AllowColumnHide="True" 
                                AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" 
                                ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                            </ClientSettings>
                </telerik:RadGrid>
            </asp:Panel>
                </td>
                </tr>
                </table>
                </div>
</div>
</td>
</tr>
</table>
</asp:panel>

</asp:Content>